<?php
include '../include/common.inc.php';
include AK_ROOT.'include/global.func.php';
include AK_ROOT.'include/admin.inc.php';
$html = 1;
if(empty($settings['html'])) $html = 0;
$htmlcategories = array(0);
$query = $db->list_by('id,html', 'categories');
foreach($category = $db->fetch_array($query)) {
	if($category['html'] + $html > 0) $htmlcategories[] = $category['id'];
}
$where = 'category IN ('.implode(',', $htmlcategories).')';
$_sql = "SELECT COUNT(id) FROM {$tablepre}_items WHERE {$where}";
$count = $db->get_field($_sql);
$_query = $db->list_by('*', 'items', $where, 'id');
$i = 1;
while($item = $db->fetch_array($_query)) {
	$percent = $i * 100 / $count;
	batchhtml($item['id']);
	debug("$percent%\t".$item['title']." [ OK ]");
	$i ++;
}
debug("All article html created.");
?>